<%--
  Created by IntelliJ IDEA.
  User: 19000
  Date: 2022/8/21
  Time: 10:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
    <meta content="webkit" name="renderer">
    <title>购物车</title>
    <link href="${pageContext.request.contextPath}/css/pintuer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/css/admin.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/js/jquery.js"></script>
    <script src="${pageContext.request.contextPath}/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 购物车</strong></div>
    <table class="table table-hover text-center">
        <tr>
            <th width="25%">商品id</th>
            <th width="25%">商品名称</th>
            <th width="25%">商品单价/元</th>
            <th width="25%">操作</th>

        </tr>

        <c:if test="${shoppingCartList != null}">

            <c:forEach items="${shoppingCartList}" var="shoppingCart">
                <tr>
                    <td>${shoppingCart.productId}</td>
                    <td>${shoppingCart.productName}</td>
                    <td>${shoppingCart.productPrice}</td>
                    <td>
                        <div class="button-group">
                            <a class="button border-red"
                               href="${pageContext.request.contextPath}/shopping/deleteShoppingCartById?shoppingCartId=${shoppingCart.id}&productId=${shoppingCart.productId}"><span
                                    class="icon-trash-o"></span> 移出购物车</a>
                        </div>

                    </td>
                </tr>
            </c:forEach>
        </c:if>

    </table>
</div>
<div class="padding border-bottom">

    <c:if test="${shoppingCartList == []}">
        <a class="button border-blue" style="position: relative;left: 78%"><span class="icon-plus-square-o"></span>
            总金额:0元</a>
    </c:if>

    <c:if test="${shoppingCartList != []}">
        <a class="button border-blue" style="position: relative;left: 78%"><span class="icon-plus-square-o"></span>
            总金额:${shoppingCartList.get(0).totalProductPrice}元</a>
    </c:if>

    <c:if test="${shoppingCartList != []}">
        <a class="button border-green" href="${pageContext.request.contextPath}/shopping/addOrder?totalProductPrice=${shoppingCartList.get(0).totalProductPrice}" style="position: relative;left: 80%"><span
                class="icon-plus-square-o"></span> 添加到订单</a>
    </c:if>


</div>


</body>
</html>
